Makes the square at (x, y) a square of the autotile `set` (write it as AUTOTILE_ and the autotile's name in capitals): the square takes the piece that fits the squares around it, and the eight squares around it look again and take the piece that fits now. Digging, building, flooding - the shape keeps its own edges and corners.
Works differently on Game Boy - Autotiles pick their pieces as on the Advance, with smaller limits: an autotile only works in a room painted from its own tileset, the game keeps at most 48 changed squares of a room at once, and the collision setting goes to the squares the call changes.
Works differently on Game Boy Color - Autotiles work as on the Advance, steep slopes and variant groups too. A room keeps at most 48 changed squares (64 with slope, face or 47-piece sets, 236 with depth layers); with depth layers a big change takes up to 3.5 s (8 s on the Game Boy) to settle.
Sega Genesis: not built yet
On other consoles this differs: see Side by side and How the consoles differ.
tile_set_auto(x, y, set)| Name | Type |
|---|---|
x | real |
y | real |
set | int |
Nothing.
Makes the square at (x, y) a square of the autotile set - write set as AUTOTILE_ and the autotile's name in capital letters - and the square takes the piece that fits the squares around it that belong to the same autotile. The eight squares around it look again too, and take the piece that fits now. A shape you make with it keeps its own edges and corners: digging, building, flooding.
x and y are a place in the room, counted from its top-left corner, as for tile_set_index. Squares past the edge of the room count as filled, so a shape that reaches the edge carries on past it.
If the autotile has a collision setting (you set it in the Room Editor), the square gets it - and so does every square that takes a new piece. The autotile's tiles must be the tiles of the room's tileset: it picks pieces of the picture the room is painted with.
Does nothing where tile_set_index does nothing: a room with no tile layer, a room too big for the live-mutable drawing budget, a point outside the room - and for an autotile that is not finished (a piece with nothing drawn). As with tile_set_index, the change is not saved and does not survive a room change.
A game that never calls tile_set_auto or tile_clear_auto has no code for them: it is built exactly as it was.
tile_set_auto(x + 8, y, AUTOTILE_GRASS);Makes the square just ahead part of the grass: it takes the piece that fits, and so do its neighbors. With the autotile drawn once in the Paint tab, a walker that leaves a trail of grass behind it keeps a tidy edge on every side.
Works on the room's drawn tiles, so it does nothing where tile_set_index does nothing (a room too big for the live-mutable budget, a room with no tile layer, a point outside the room). Squares past the edge of the room count as filled. The autotile's collision setting, if it has one, is set on the square. Like tile_set_index, a change does not persist across a room change.